package com.gec.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gec.model.system.ITripCity;
import com.gec.model.system.ITripHotel;
import com.gec.model.system.ITripItineraryOrder;
import com.gec.model.vo.ITripHotelVo;
import com.gec.system.mapper.ITripHotelMapper;
import com.gec.system.service.ITripHotelService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 酒店表 服务实现类
 * </p>
 *
 * @author dafei
 * @since 2024-01-24
 */
@Service
public class ITripHotelServiceImpl extends ServiceImpl<ITripHotelMapper, ITripHotel> implements ITripHotelService {

    @Override
    public IPage<ITripHotel> selectPage(IPage<ITripHotel> p1, ITripHotelVo iTripHotelQueryVo) {
        IPage<ITripHotel> iPage = this.baseMapper.selectPage(p1,iTripHotelQueryVo,null) ;
        return iPage;
    }

    @Override
    public List<ITripHotel> selectPage() {
        List<ITripHotel> iPage = this.baseMapper.selectPage();
        return iPage;
    }

    @Override
    public ITripHotel selectByName(String hotelName) {
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("hotelName",hotelName);//相当于where name=1
        List<ITripHotel> list = baseMapper.selectList(wrapper);
        return list.size()==0 ?null :list.get(0);
    }
}
